package com.emep.changzhi.analyse.repository.basics;
import com.emep.changzhi.analyse.entity.basics.SysIndustryTypeInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @author xy
 * @Description: 行业持久层
 * @date 2018/2/26 9:35
 * @version V1.0
 */
public interface SysIndustryTypeRepository extends BaseRepository<SysIndustryTypeInfo, Long> {

    @Modifying
    @Transactional
    Integer deleteById(String id);

    SysIndustryTypeInfo findIndustryTypeById(String id);

    Page<SysIndustryTypeInfo> findAll(Specification<SysIndustryTypeInfo> spec, Pageable pageable);

    List<SysIndustryTypeInfo> findAllByIndustryTypeNameAndIsDelete(String name, String isDelete);

    List<SysIndustryTypeInfo> findAllByIndustryTypeNameAndIdNotAndIsDelete(String name, String Id,String isDelete);
}
